package net.wofly.sale.exchange.service;


import net.wofly.common.condition.Condition;
import net.wofly.common.persistence.PageWrapper;
import net.wofly.common.util.ReturnBean;
import net.wofly.sale.exchange.domain.CardExchange;
import net.wofly.sale.exchange.domain.ExchangeConsume;
import net.wofly.sale.exchange.domain.ExchangeStock;

/**
 * @author lign
 * @version 1.0
 * @created 28-九月-2017 21:36:38
 */
public interface IExchangeService {

	/**
	 * 添加兑换
	 * <ul>
	 * 	<li>添加后，自动增加相应的库存</li>
	 * 	<li></li>
	 * </ul>
	 * 
	 * @param cardExchange
	 */
	ReturnBean<CardExchange> addCardExchange(CardExchange cardExchange);

	/**
	 * 增加兑换消费
	 * <ul>
	 * 	<li>增加后自动减动当前用户兑换库存</li>
	 * 	<li></li>
	 * </ul>
	 * 
	 * @param exchangeConsume
	 */
	ReturnBean<ExchangeConsume> addExchangeConsume(ExchangeConsume exchangeConsume);

	/**
	 * 分页获取兑换库存
	 * <ul>
	 * 	<li></li>
	 * </ul>
	 * 
	 * @param pageNum
	 * @param pageSize
	 * @param condition
	 */
	ReturnBean<PageWrapper<ExchangeStock>> getAllExchangeStock(Integer pageNum, Integer pageSize, Condition condition);

	/**
	 * 
	 * @param userID
	 */
	ReturnBean<PageWrapper<CardExchange>> getMyCardExchange(String userID, Integer pageNum, Integer pageSize);
	
	/**
	 * 
	 * @param userID
	 */
	ReturnBean<PageWrapper<CardExchange>> getAllCardExchange(String salesUserID, String customerUserID ,Integer pageNum, Integer pageSize);


	/**
	 * 
	 * @param userID
	 */
	ReturnBean<PageWrapper<ExchangeConsume>> getMyExchangeConsume(String userID, Integer pageNum, Integer pageSize);

	/**
	 * 获取指定用户的兑换库存
	 * 
	 * @param userID
	 */
	ReturnBean<ExchangeStock> getMyExchangeStock(String userID);
	
	/**
	 * 获取兑换详情
	 * 
	 * 
	 * @param cardExchangeID
	 * @return
	 */
	public ReturnBean<CardExchange> getCardExchangeDetail(String cardExchangeID);

}